package com.lch.webdemo.controller.huihui;

import com.lch.webdemo.common.msg.AjaxResult;
import com.lch.webdemo.service.ILeaveMsgService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @author: liuchenhui
 * @create: 2019-02-24 23:19
 **/
@Controller
public class LeaveMsgController {

    private static final Logger LOGGER = LoggerFactory.getLogger(LeaveMsgController.class);

    @Resource
    ILeaveMsgService leaveMsgService;

    @RequestMapping("/msg/add")
    @ResponseBody
    public AjaxResult addMsg(String title, String msg, String name) {
        LOGGER.info("开始增加留言");
        leaveMsgService.addMsg(name, msg, title);
        return new AjaxResult(0, "成功", true, null);
    }
}
